<template>
  <div>
    <input
      type="text"
      @input="
        (e) => {
          $emit('update:title', e.target.value);
        }
      "
    />{{ value }}
  </div>
</template>

<script lang="ts">
import { reactive, getCurrentInstance, toRefs } from "vue";
export default {
  props: ["title"],
  emits: ["update:title"],
  setup(props: any, ctx: any) {
    console.log(props, ctx, "qinput");
    let self: any = getCurrentInstance();
    console.log(self, "qinput");
    const data = reactive({
      value: "",
    });
    const change = (e: Event) => {
      data.value = (e.target as HTMLInputElement).value;
    };
    return {
      change,
      ...toRefs(data),
    };
  },
};
</script>

<style></style>
